package com.kgc.book;

public class Books {
    private String bookld;
    private String bookName;
    private String press;
    private  int price;

    public Books(){

    }
    public Books( String press,int price){

        this.setPress(press);
        this.setPrice(price);
    }
    public void report(){
        System.out.println("书名"+this.getBookld()+"作者名"+this.getBookName()+"出版社"+this.press+"定价"+this.price);

    }
    public String getBookld(){
        return this.bookld="小黄书";
    }

    public String getBookName(){
        return this.bookName="阿宾";
    }

    public String getPress(){
        return this.press;
    }
    public void setPress(String press){
        this.press=press;
    }
    public int getPrice(){
        return this.price;
    }
    public void setPrice(int price){
        if (price>10){
        this.price=price;}
        else {
            this.price=20;
            throw new RuntimeException("价格要大于10");
        }
    }

}
